﻿using Code;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Threading.Tasks;

namespace Models {
    public class IncomeInfo {
        [DisplayName("编号")]
        public long Id { get; set; }

        [Required, Column("CreateTime", TypeName = "datetime")]
        [DisplayName("时间")]
        public DateTime CreateTime { get; set; } = DateTime.Now;

        [Required, Column("SystemType", TypeName = "smallint")]
        public SystemType SystemType { get; set; }


        [DisplayName("类型")]
        public string strSystemType {
            get {
                return SystemType.ToString();
            }
        }

        [Required, Column("IncomePrice", TypeName = "money")]
        public decimal IncomePrice { get; set; }

        [DisplayName("金额")]
        public string strPrice {
            get {
                return IncomePrice.ToString("C");
            }
        }

        [Required, Column("Remark", TypeName = "nvarchar(500)")]
        [List("Order", 100)]
        [DisplayName("备注")]
        public string Remark { get; set; }

        public long UserId { get; set; }

        [Required, Column("UserName", TypeName = "varchar(20)")]
        public string UserName { get; set; }

        [DisplayName("来源单号")]
        [Column("SourceId", TypeName = "varchar(20)")]
        public string SourceId { get; set; }
    }
}
